import React, { Component } from 'react';
import {
    StyleSheet,
    Text,
    Image,
    TouchableHighlight,
    View,
} from 'react-native';

export default class CreationItem extends Component {
    // 构造函数
    constructor(props) {
        super(props);
        //console.log(props)
        this.state = {
            //
        }
    }
    link(id){
        console.log(id)
    }
    //<TouchableHighlight underlayColor ="rgba(34,26,38,0.1)" onPress={this.link.bind(this,gameid)}></TouchableHighlight>
    render() {
        const { row: { name, gameid, typename, publicity, micon, downloads } } = this.props
        return (
            <View style={styles.container}>
                <Image source={{ uri: micon }} style={styles.img} />
                <View style={styles.item}>
                    <Text style={styles.text}>{name}</Text>
                    <Text style={styles.text1}>{typename}-下载量:{downloads}</Text>
                    <Text>{publicity}</Text>
                </View>
            </View>
        )
    }
}
// 样式
const styles = StyleSheet.create({
    container: {
        flexDirection: 'row',
        alignItems: 'center',
        marginVertical: 10
    },
    img: {
        width: 100,
        height: 100,
        marginHorizontal: 10,
        borderRadius: 5
    },
    item: {
        flex: 1,
        flexDirection: 'column'
    },
    text: {
        fontSize: 18
    },
    text1: {
        paddingVertical: 10,
    }
});